$OpenBSD: patch-ext_session_session_c,v 1.1 2016/02/06 23:31:20 sthen Exp $

Perhaps the whole function can be replaced, but we have to start somewhere.

--- ext/session/session.c.orig.port	Mon Feb  1 23:04:02 2016
+++ ext/session/session.c	Mon Feb  1 23:48:25 2016
@@ -346,7 +346,11 @@ PHPAPI char *php_session_create_id(PS_CREATE_SID_ARGS)
 	efree(buf);
 
 	if (PS(entropy_length) > 0) {
-#ifdef PHP_WIN32
+#if defined(__OpenBSD__)
+		unsigned char rbuf[2048];
+		size_t toread = PS(entropy_length);
+		arc4random_buf(rbuf, MIN(toread, sizeof(rbuf)));
+#elif defined(PHP_WIN32)
 		unsigned char rbuf[2048];
 		size_t toread = PS(entropy_length);
 
